package com.atguigu.visitor.demo2;

public class Client {

	public static void main(String[] args) {

		AccountBook accountBook = new AccountBook();

		// 添加两条收入
		accountBook.addBill(new BillForIncome(10000, "卖商品"));
		accountBook.addBill(new BillForIncome(12000, "卖广告位"));

		// 添加两条支出
		accountBook.addBill(new BillForConsume(1000, "工资"));
		accountBook.addBill(new BillForConsume(2000, "材料费"));

		AccountBookViewer boss = new AccountBookViewerForBoss();
		AccountBookViewer cpa = new AccountBookViewerForCpa();

		// 两个访问者分别访问账本
		accountBook.show(cpa);
		accountBook.show(boss);

		((AccountBookViewerForBoss) boss).getTotalConsume();
		((AccountBookViewerForBoss) boss).getTotalIncome();
	}
}